//Author: Rahul Nayak

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.Color;

public class Location 
{
	public JButton myBox;
	public Piece myPiece;
	public int myX, myY;
    public Location(Color myColor, int x, int y, Piece piece) 
    {
    	myX = x;
    	myY = y;
    	myBox = new JButton();
    	myBox.setBackground(myColor);
    }
    
    public JButton getBox()
    {
    	return myBox;
    }
    
    public int getX()
    {
    	return myX;
    }
    
    public int getY()
    {
    	return myY;
    }
    
    public void setPiece(Piece piece)
    {
    	if(piece != null)
    		myBox.setIcon(new ImageIcon(piece.getPic()));
    	else
    		myBox.setIcon(null);
    	myPiece = piece;
    }
    
    
}